Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

data-prefetch=false #3286

Closed
wants to merge 2 commits into from
Closed

data-prefetch=false #3286

wants to merge 2 commits into from

Conversation

pehrlich
Copy link

re: feature request #3263 (mine)

pages with data-prefetch=false will no longer be preloaded.

I also went through the source and looked for other instances of elements being selected by virtue of having an attribute, no matter the value. I don't think I know enough to say whether they too should be updated for consistency, so I'll just list them here:

In widget#_create:  iconpos = $navbtns.filter( ":jqmData(icon)" ).length ? this.options.iconpos : undefined;

// In listview creation: 
    if ( $( this ).jqmData( "inset" ) ) {
        wrapper.addClass( "ui-listview-filter-inset" );
    }

//And in adding dialogs: 
    // unless the data url is already set set it to the pathname
    if ( !$this.jqmData("url") ) {
        $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );

Coincidentally, in childPages:

return $( ":jqmData(url^='"+  parentUrl + "&" + $.mobile.subPageUrlKey +"')");

I couldn't figure out what ^= is does-- certainly not !=. Is this a bug?

Cheers

@johnbender
Copy link
Contributor

@pehrlich

I might be missing something here but omitting the data-prefetch has the same effect doesn't it? compounding pseudo selectors is generally bad for performance so I'm wondering what the use case is here.

Sorry for the late response.

@pehrlich
Copy link
Author

pehrlich commented Apr 6, 2012

Interesting, I'd be interested to hear more on selector performance there.

The use case is a rails plugin, jquery_helper, which auto generates this markup. It has to make special cases here instead of just falsing. But from this perspective, that's kind of what rails helpers are for :)

On Friday, April 6, 2012 at 11:54 AM, John Bender wrote:

@pehrlich

I might be missing something here but omitting the data-prefetch has the same effect doesn't it? compounding pseudo selectors is generally bad for performance so I'm wondering what the use case is here.

Sorry for the late response.


Reply to this email directly or view it on GitHub:
#3286 (comment)

@johnbender
Copy link
Contributor

@pehrlich

Being a rails dev myself I would agree :D.

It's also something we need to consider in terms of semantics because native browser boolean attributes (disabled) are true with any value at all, though of course this is of course a data attr. Things to think about.

I'm going to add the boolean attributes as false feature request but it's likely to be at the very bottom of the queue. Thanks for submitting and responding so promptly.

@johnbender johnbender closed this Apr 6, 2012
@pehrlich
Copy link
Author

pehrlich commented Apr 6, 2012

This is totally off topic, but just while it's brought up--

I am no longer maintaining jquey_helper as a gem, but would like others to know about if if they have a use, and am still around to fix bugs. It handles a lot of markup generation (back and forward buttons, full with transitions), allows data attrs to be specified with their own hash, and even has a nav bar builder which keeps page transition directions straight.

Cheers!

Sent from my iPhone

On Apr 6, 2012, at 1:44 PM, John [email protected] wrote:

@pehrlich

Being a rails dev myself I would agree :D.

It's also something we need to consider in terms of semantics because native browser boolean attributes (disabled) are true with any value at all, though of course this is of course a data attr. Things to think about.

I'm going to add the boolean attributes as false feature request but it's likely to be at the very bottom of the queue. Thanks for submitting and responding so promptly.


Reply to this email directly or view it on GitHub:
#3286 (comment)

@johnbender
Copy link
Contributor

@pehrlich

@toddparker could add a link to our resources page if you'd like.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants